/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.comunicacion2.view;

import java.awt.Graphics;
import java.awt.Image;
import javax.swing.JPanel;

/**
 *
 * @author LangTecnologia
 */
@SuppressWarnings("serial")
class ImagePanel extends JPanel {
    private Image image;

    ImagePanel() {
    }

    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        if(image != null){
            g.drawImage(image, 0, 0, getWidth(), getHeight(), this);
        }
    }
    
    public void setImage(Image image){
        this.image = image;
        repaint();
    }
}